﻿@namespace BootstrapBlazor.Components
@typeparam TValue
@inherits BootstrapInputNumberBase<TValue>

@if (IsShowLabel)
{
    <BootstrapLabel required="@Required" for="@Id" ShowLabelTooltip="ShowLabelTooltip" Value="@DisplayText" />
}
@if (ShowButton)
{
    <div class="input-group">
        <button class="@ButtonClassString" type="button" @onclick="OnClickDec" disabled="@Disabled">
            <i class="@MinusIcon"></i>
        </button>
        @RenderInput
        <button class="@ButtonClassString" type="button" @onclick="OnClickInc" disabled="@Disabled">
            <i class="@PlusIcon"></i>
        </button>
    </div>
}
else
{
    @RenderInput
}

@code {
    RenderFragment RenderInput =>
    @<input @attributes="AdditionalAttributes" step="@StepString" min="@Min" max="@Max" id="@Id" type="number" placeholder="@PlaceHolder" class="@InputClassString" disabled="@Disabled" @bind-value="@CurrentValueAsString" @bind-value:event="@EventString" @onblur="@OnBlur" />;
}
